<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Order Service</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f0f0f0;
        }
        .container {
            text-align: center;
        }
        button {
            padding: 10px 20px;
            font-size: 16px;
            cursor: pointer;
        }
        .message {
            margin-top: 20px;
            font-size: 14px;
            color: #333;
        }
    </style>
</head>
<body>
<div class="container">
    <h1>Order Service</h1>
    <button id="orderButton">Add Order</button>
    <div class="message" id="message"></div>
</div>
<script>
    document.getElementById('orderButton').addEventListener('click', function() {
        fetch('http://localhost:8080/order-service/order/add', {
            method: 'POST'
        })
            .then(response => {
                if (response.ok) {
                    return response.json();
                } else {
                    throw new Error('Network response was not ok.');
                }
            })
            .then(data => {
                document.getElementById('message').innerText = 'Order added successfully!';
            })
            .catch(error => {
                document.getElementById('message').innerText = 'Error adding order: ' + error;
            });
    });
</script>
</body>
</html>
